
#include "CGameApplication.h"
#include "Image.h"

Image::Image(const Image& cSource)
{
	ID = cSource.ID;
	filename = cSource.filename;
	texture = CGameApplication::getInstance()->getCImageManager()->imageToGLTexture(filename);
	width = cSource.width;
	height = cSource.height;
	pos_x = cSource.pos_x;
	pos_y = cSource.pos_y;
	offsetx = cSource.offsetx;
	offsety = cSource.offsety;
	isActive = cSource.isActive;
}

Image& Image::operator=(const Image& cSource)
{
	ID = cSource.ID;
	filename = cSource.filename;
	texture = CGameApplication::getInstance()->getCImageManager()->imageToGLTexture(filename);
	width = cSource.width;
	height = cSource.height;
	pos_x = cSource.pos_x;
	pos_y = cSource.pos_y;
	offsetx = cSource.offsetx;
	offsety = cSource.offsety;
	isActive = cSource.isActive;

	return *this;
}

Image::~Image()
{
	glDeleteTextures(1, &texture); 
}